package com.zzq.my.jetpacks.jectpackapp.ui.act

import android.view.View
import by.kirich1409.viewbindingdelegate.viewBinding
import com.aisier.architecture.base.BaseActivity
import com.google.android.material.tabs.TabLayoutMediator
import com.jennifer.andy.androidxlazyload.demo.adapter.FragmentLazyStateAdapter
import com.zzq.my.jetpacks.jectpackapp.*
import com.zzq.my.jetpacks.jectpackapp.databinding.*

/**
 * 描述：ViewPager2 本身就支持对实际可见的 Fragment 才调用 onResume 方法
 * 作者：zhuangzeqin
 * 时间: 2022/1/18-17:04
 * 邮箱：zzq@eeepay.cn
 * 备注:
 */
class Activity7 : BaseActivity(R.layout.activity_7),View.OnClickListener{
    private val binding by viewBinding(Activity7Binding::bind)
    /**
     * 初始化数据
     */
    override fun initData() {
        val viewPager2 = binding.viewPager2.apply {
            adapter = FragmentLazyStateAdapter(this@Activity7, generateTextFragments(4))
        }
        TabLayoutMediator(binding.tabLayout, viewPager2) { tab, position ->
            tab.text = "Fragment ${position + 1}"
        }.attach()
    }

    /**
     * 初始化操作
     */
    override fun initView() {

    }

    /**
     * 初始化点击事件操作
     */
    override fun eventOnClick() {

    }

    override fun onClick(v: View) {

    }

}